<%-- 
    Document   : view
    Created on : Mar 8, 2010, 10:49:03 AM
    Author     : Jagadeesh
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.*" %>
<%@page import="model.UserBean" %>

    <link rel="stylesheet" href="css/bootstrap.css">
    <link rel="stylesheet" href="css/another.css">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Rekap Senjata</title>
    </head>
    <body>
       
      <div id="indexLeftColumn"> 
       <pre>
<img src="gambar/logoo.PNG" id="logo" alt="logo">
<center><a class="btn btn-default" href="<%=request.getContextPath()%>/index.jsp">Home</a></center>
<center><a class="btn btn-default" href="<%=request.getContextPath()%>/tambahRekap.jsp">Add</a></center>
<center><a class="btn btn-default" href="<%=request.getContextPath()%>/cariRekap.jsp">Search</a></center>
<center><a class="btn btn-primary" href="<%=request.getContextPath()%>/login.jsp">Log Out</a></center>
<img src="gambar/head2.PNG" id="logo" alt="logo">
    </pre> 
  </div>
           <div id="indexRightColumn">
              <h1>Rekap Senjata</h1>
        <table class="table table-striped">
            <tr>
                <th>ID Senjata</th>
               <th>Nama Senjata</th>               
               <th>Jenis</th>
          
               <th>Tahun Dibuat</th>
               <th>Tahun Dibeli</th>
                <th>Status</th>
              
               <th>action</th>
               
            </tr>
            
                  
               
            
            <%
              if (session.getAttribute("userName") == null) {

                    RequestDispatcher rd = request.getRequestDispatcher("login.jsp");
                    rd.forward(request, response);}
                    
                
               List list = (List)request.getAttribute("list");
               if(list!=null)
                   {
                     for(int i=0 ; i< list.size();i++)
                         {
                           UserBean ubean =(UserBean) list.get(i);

            %>
                <tr>
                  
                   <td><%=ubean.getIdSenjata()%></td>      
                    <td><%=ubean.getNamaSenjata()%></td>
                    <td><%=ubean.getJenis()%></td>               
               
                    <td><%=ubean.getThnDibuat()%></td>
                    <td><%=ubean.getThnDibeli()%></td>
                    <td><%=ubean.getStatus()%></td>
                    <td><a href="ControllerServlet?action=edit2&idSenjata=<%=ubean.getIdSenjata()%>">update</a>
                        |
                        <a href="ControllerServlet?action=delete2&idSenjata=<%=ubean.getIdSenjata()%>">delete</a></td>
                </tr>
            <%
                         }
                   }
             %>
        </table>
           </div>
           </body>
</html>
